import  { createStore, combineReducers} from 'redux';
import { CollApsedReducer } from './reducers/CollapsedReducer';
import { LoadingReducer } from './reducers/LoadingReducer';

const reducer = combineReducers({ //组织多个redecer,同时保持各自逻辑块的独立性
    CollApsedReducer,
    LoadingReducer
});
/* 1. 创建一个 Redux store 来以存放应用中所有的 state。
   2. 应用中应有且仅有一个 store
*/
const store = createStore(reducer);
export default store;

/*
 store.dispatch() //改变state 唯一的方法就是通过action来 触发 分发器Dispatcher

 store.subsribe()

*/